using UnityEngine;
using BehaviorDesigner.Runtime;
using BehaviorDesigner.Runtime.Tasks;

public class Cast : Action
{
    public GameObject player;
    public GameObject spell;

    public override void OnStart(){
        //生成技能攻击特效
        float playerH = player.gameObject.GetComponent<SpriteRenderer>().sprite.bounds.size.y; //通过SpriteRenderer获得人物高度
        Object.Instantiate(spell, player.transform.position + new Vector3(0, playerH, 0), Quaternion.identity);
    }

    public override TaskStatus OnUpdate()
    {
        //判断。。。
        return TaskStatus.Success;
    }

    public override void OnEnd(){
        Debug.Log("打印2");
    }

}